<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>活动列表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="../../css/utils/mui.min.css" />
	<link rel="stylesheet" href="../../css/utils/toastr.min.css" />
	<title></title>
	<style>
		body {
			padding: 0;
			margin: 0;
			font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
			font-size: 14px;
			background-color: #fff;
		}
		.content {
			padding: 15px;
		}
		.activity-container {
			width: 100%;
			height: 100%;
		}
		.activity-item {
			width: 100%;
			height: 100%;
			position: relative;
		}
		.activity-img {
			width: 100%;
			height: 185px;
		}
		.shadow-layer {
			width: 100%;
			height: 185px;
			text-align: center;
			position: absolute;
			top: 0px;
			left: 0px;
			background-image: url(../../img/phone/activity_bg.png);
			background-size: 100% 100%;
		}
		h4 {
			color: #FFFFFF;
			margin: 25px;
			overflow:hidden; 
			text-overflow:ellipsis;
			display:-webkit-box; 
			-webkit-box-orient:vertical;
			-webkit-line-clamp:2; 
			line-height: 25px;
		}
		p {
			color: #FFFFFF;
		}
	</style>
</head>
<body>
	<div class="content">
		<div class="activity-container">
			<!--<div class="activity-item">
				<img class="activity-img" src="../../img/phone/activity_bg.png" />
				<div class="shadow-layer">
					<h4>活动主题活动主题活动</h4>
					<p>开始时间：2018.07.01-2018.07.08</p>
					<p>活动地址：八鸽岩路樱花巷</p>
				</div>
			</div>-->
		</div>
	</div>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script type="text/javascript" src="../../js/utils/jquery-1.12.4.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/mui.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/regular.js" ></script>
	<script type="text/javascript">
		document.write('<script type="text/javascript" src="../../js/utils/boot.js?v='+new Date().getTime()+'" ><\/script>');
	</script>
	<script>
		var openID = base.getParameter("openID");
		$(function(){
			getShowMyActivity();
		});
		function getShowMyActivity() {
			var url = base.url.showMyActivity;
			var data = {
				openID: openID
			};
			base.postData(url,data,getShowMyActivityData);
		}
		function getShowMyActivityData(data) {
			if (data.success) {
				if (data.context.showMyActivityList) {
					$(".activity-container").html(getActivityHtml(data.context.showMyActivityList));
				}
			} else {
				mui.toast(data.msg);
			}
		}
		function getActivityHtml (list) {
			var html = '';
			for (var index in list) {
				html += '<div class="activity-item">'
				html += '	<img class="activity-img" src="'+list[index].activityImg+'" />'
				html += '	<input type="hidden" value="'+list[index].activityID+'" class="activityID" />'
				html += '	<input type="hidden" value="'+list[index].theme+'" class="theme" />'
				html += '	<input type="hidden" value="'+list[index].attention+'" class="attention" />'
				html += '	<input type="hidden" value="'+list[index].organizer+'" class="organizer" />'
				html += '	<input type="hidden" value="'+list[index].contractor+'" class="contractor" />'
				html += '	<div class="shadow-layer">'
				html += '		<h4>'+list[index].theme+'</h4>'
				html += '		<p class="activity-date">活动时间：'+list[index].activityStartTime+'-'+list[index].activityEndTime+'</p>'
				html += '		<p class="activity-addr">活动地址：'+list[index].activityAddress+'</p>'
				html += '	</div>'
				html += '</div>'
			}
			return html;
		}
		$(".activity-container").on("click", ".activity-item", function(){
			var _activityID = $(this).find("input[class='activityID']").val();
			var _theme = $(this).find("input[class='theme']").val();
			var _attention = $(this).find("input[class='attention']").val();
			var _organizer = $(this).find("input[class='organizer']").val();
			var _contractor = $(this).find("input[class='contractor']").val();
			var _activityDate = $(this).find(".activity-date").text();
			var _activityAddr = $(this).find(".activity-addr").text();
			parent.location.href = "ticketsDetail.html?openID="+openID+"&activityID="+_activityID+"&theme="+_theme+"&attention="+_attention+"&organizer="+_organizer+"&contractor="+_contractor+"&activityDate="+_activityDate+"&activityAddr="+_activityAddr;
		});
	</script>
</body>
</html>
